import request from '@/utils/request'

//1.查询品牌列表

//参数类型
export interface trademarkListParamType {
  page: number,
  limit: number
}



export interface trademarkListReturnRecordsItemType extends addTrademarkListParamType{
  id: number,

}

export type trademarkListReturnRecordsType = trademarkListReturnRecordsItemType[]

//返回值类型
export interface trademarkListReturnType {
  records:trademarkListReturnRecordsType ,
  total: number,
  size: number,
  current: number,
  searchCount: boolean,
  pages: number
}
export const requestTrademarkList = ({ page, limit }: trademarkListParamType) => {
  return request.get<any,trademarkListReturnType>(`/admin/product/baseTrademark/${page}/${limit}`)
}

//2.修改trademark
export const requestUpdateTrademark = (trademark:trademarkListReturnRecordsItemType)=>{
  return request.put<any,null>('/admin/product/baseTrademark/update',trademark)
}

//3.新增trademark
export interface addTrademarkListParamType{
  tmName: string,
  logoUrl: string
}
export const requestAddTrademark = (trademark:addTrademarkListParamType)=>{
  return request.post<any,null>('/admin/product/baseTrademark/save',trademark)
}

//4.删除trademark
export const requestDeleteTrademark = (id:number)=>{
  return request.delete<any,null>(`/admin/product/baseTrademark/remove/${id}`)
}


